﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseSystem.Common;
using ExpenseSystem.Common.BaseModel;
using ExpenseSystem.DataUpdater;
using ExpenseSystem.Fether;
using ExpenseSystem.Model;
using ExpenseSystem.Core.DataAddOn;
using System.Web;

namespace ExpenseSystem.Core.BonusModules
{
    public abstract  class CustomerOtherManager : INormalManager<CustomerOtherModel>, IApproveable<CustomerOtherModel>
    {
        protected string tran = HttpContext.Current.Items[Definition.SESSION_TRAN_STR].ToString();
        protected UserProfile profile = Authority.Authority.GetUserProfile();
        public static CustomerOtherManager CreateInstance()
        {
            return new CustomerOtherUpdCusManager (new CustomerOtherBaseManager());
        }
        protected NormalDataUpdater<CustomerOtherModel> updater = new CustomerOtherUpdaterRegister().GetOtherUpdater();
        public abstract bool Delete(CustomerOtherModel site, out string message);
        public abstract bool DeleteById(long[] siteId, out string message);
        public abstract bool Save(CustomerOtherModel site, out string message, params IAddable<CustomerOtherModel>[] addables);
        public virtual bool Approved(long id, out string message)
        {
            ApprovedHelper<CustomerOtherModel> approvedHelper = new ApprovedHelper<CustomerOtherModel>(new CustomerOtherFetcher(), this);
            return approvedHelper.Approved(id, out message);
        }

        public virtual bool Reject(long id, out string message)
        {
            ApprovedHelper<CustomerOtherModel> approvedHelper = new ApprovedHelper<CustomerOtherModel>(new CustomerOtherFetcher(), this);
            return approvedHelper.Reject(id, out message);
        }

        public virtual bool Comfirm(long id, out string message)
        {
            ApprovedHelper<CustomerOtherModel> approvedHelper = new ApprovedHelper<CustomerOtherModel>(new CustomerOtherFetcher(), this);
            return approvedHelper.Comfirm(id, out message);
        }

        public virtual bool Submit(long modelid, out string message)
        {
            ApprovedHelper<CustomerOtherModel> approvedHelper = new ApprovedHelper<CustomerOtherModel>(new CustomerOtherFetcher(), this);
            return approvedHelper.Submit(modelid, out message);
        }

        public virtual bool Recall(long modelid, out string message)
        {
            ApprovedHelper<CustomerOtherModel> approvedHelper = new ApprovedHelper<CustomerOtherModel>(new CustomerOtherFetcher(), this);
            return approvedHelper.Recall(modelid, out message);
        }

        public virtual bool Revert(long modelid, out string message)
        {
            ApprovedHelper<CustomerOtherModel> approvedHelper = new ApprovedHelper<CustomerOtherModel>(new CustomerOtherFetcher(), this);
            return approvedHelper.Revert(modelid, out message);
        }
    }
}
